base_polygon_1 = new polygon graph_width,0,0; 0,0,0; 0,graph_height,0; graph_width,graph_height,0 material base_material
base_polygon_2 = new polygon 0,0,0; 0,graph_height,0; 0,graph_height,graph_width; 0,0,graph_width material base_material
base_polygon_3 = new polygon 0,0,0; 0,0,graph_width; graph_width,0,graph_width; graph_width,0,0 material base_material
base_polygon_4 = new polygon graph_width,-graph_height/4,graph_width; 0,-graph_height/4,graph_width; 0,0,graph_width; graph_width,0,graph_width material base_material
base_polygon_5 = new polygon graph_width,-graph_height/4,0; graph_width,-graph_height/4,graph_width; graph_width,0,graph_width; graph_width,0,0 material base_material
load "usflag.gif" bitmap usflag
load "ukflag.gif" bitmap ukflag
load "texture1.gif" bitmap texture1
load "texture2.gif" bitmap texture2
if GRAPHICS_WINDOW_BITS == 8
compose bitmap usflag
compose bitmap ukflag
compose bitmap texture1
compose bitmap texture2
remap bitmap usflag
remap bitmap ukflag
remap bitmap texture1
remap bitmap texture2
texture base_polygon_1 bitmap usflag
texture base_polygon_2 bitmap ukflag
texture base_polygon_4 bitmap texture1
texture base_polygon_5 bitmap texture2
allocate_colors:
my_pal = new byte[256][3]
for n = 1 to 32
r = n * 8 - 1
g = n * 7 - 1
b = n * 4 - 1
my_pal[n-1][0] = r,b,g
compose palette my_pal
draw_graph_bars:
for x = 1 to graph_width
for z = 1 to graph_width
bar = call draw_bar
render mesh bar mode RENDER_QUICK
free bar
draw_bar:
k = call graph_function: x-graph_width/2, z-graph_width/2, graph_width
y = k * graph_height
poly_list = new object list
poly_1 = new polygon x,y,z; x,y,z-1; x-1,y,z-1; x-1,y,z material base_material
poly_list push @poly_1
if (y > 0.1)
poly_2 = new polygon x,y,z; x,y,z-1; x,0,z-1; x,0,z material base_material
poly_3 = new polygon x,y,z; x-1,y,z; x-1,0,z; x,0,z material base_material